package LinkedList;

import java.util.LinkedList;

/**
 * @author Administrator
 * @ClassName LinKedTest
 * @TIME 星期三 2020/12/30
 */
public class LinKedTest {
    public static void main(String[] args) {
        LinkedList<String> linKedList = new LinkedList<>();
        linKedList.add("One");
        linKedList.addFirst("First Two");
        linKedList.add("Three");
        linKedList.addLast("Last Four");
        System.out.println(linKedList);
        System.out.println("First: " + linKedList.getFirst());
        System.out.println("Last: " + linKedList.getLast());
        System.out.println("FirstRemove: " + linKedList.removeFirst());
        System.out.println("LastRemove: " + linKedList.removeLast());
        System.out.println("查询: " + linKedList.subList(0, linKedList.size()));
    }
}
